#include "logout.h"
#include "../gateway.h"

Logout::Logout()
: m_state(STATE_START)
, m_nextState(STATE_LOGOUT)
{
}

Logout::~Logout()
{
}

void Logout::Update()
{
	if(m_nextState != m_state)
	{
		SetState(m_nextState);
	}	
	
	switch(m_state)
	{
	case STATE_LOGOUT:
		SetState(STATE_END);
		break;

	default:
		break;
	}
}

void Logout::SetState(State state)
{
	switch(state)
	{
	case STATE_LOGOUT:
		m_gateway->SetState(Gateway::STATE_CLOSING_SERVICE);
		break;

	case STATE_END:
		m_bDone = true;
		break;
	}

	m_state = state;
	m_nextState = m_state;
}